package com.example.demo.controller;

import com.example.demo.dto.GoodsPageRequest;
import com.example.demo.entity.Goods;
import com.example.demo.service.GoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * GoodsController
 *
 * @author liujin
 * @date 2020/12/18 13:16
 */
@Api(tags = "菜品模块")
@RestController
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @ApiOperation(value = "查看菜单")
    @PostMapping("/goods/page")
    public List<Goods> page(@RequestBody @Valid GoodsPageRequest request) {
        return goodsService.page(request);
    }

}
